﻿#ifndef CUSTOMTEXTEDIT_H
#define CUSTOMTEXTEDIT_H

#include <QTextEdit>
#include <QTextBrowser>
#include <QResizeEvent>
#include <QPainter>
#include <QPropertyAnimation>

class CustomTextEdit : public QFrame
{
    Q_OBJECT
public:
    CustomTextEdit(QWidget* parent = nullptr);
    virtual ~CustomTextEdit() {}
    void setPlaceholderText(QString strText);
    void setMsgShow(QString strInfo);
    bool showMsg();
    QString getDocument();
    void clear();
protected:
    void resizeEvent(QResizeEvent* event) override;
private:
    void reshow(const bool bShow);
    void reshowAnimat(const bool bShow);

private:
    bool m_bMsgShow;
    QTextEdit* m_pInputTextEdit;
    QTextBrowser* m_pMsgShower;
    QPropertyAnimation* m_pAnimationText;
    QPropertyAnimation* m_pAnimationMsg;
};

#endif
